import json


def load_json_data(filename):
    """Load JSON data from a file."""

    try:
        with open(filename, 'r', encoding='UTF8') as file:
            return json.load(file)
    except FileNotFoundError:
        return {}


def save_json_data(data, filename):
    """Save JSON data to a file."""
    with open(filename, 'w', encoding='UTF8') as file:
        json.dump(data, file, indent=4)
